package com.leonardo.persistenceme.model;

import java.util.Hashtable;

import com.leonardo.persistenceme.exceptions.DatabaseOpenException;


public class PersistenceManagerFactory {

	private static Hashtable managers = new Hashtable();
	
	public static PersistenceManager getPersistenceManager(String id) throws DatabaseOpenException {
		if(managers.containsKey(id))
			return (PersistenceManager) managers.get(id);
		PersistenceManager manager = new PersistenceManagerImpl(id);
		managers.put(id, manager);
		return manager;
	}
	
}
